<?php
$this->assign("title", "Historial Reservas");

$this->start('css');

    echo $this->Html->css('jquery.dataTables.css');
    echo $this->Html->css('TableTools');
    echo $this->Html->css('miBus-admin');

$this->end();

$this->start('script');

    echo $this->Html->script("jquery.dataTables.min");
    echo $this->Html->script("TableTools.min");
    echo $this->Html->script('Index/mis_reservas_completas.min');
?>
<script type="text/javascript">
    if (!window.dataTableProcessing) {
        window.dataTableProcessing = {};
    }
    var webroot = "<?php echo Router::url('/', $full_base = true); ?>";
    dataTableProcessing.misReservasTable = {
        "processing": true,
        "serverSide": true,
        "ajax": {
            "url": webroot + "Index/retrieve_all_mis_reservas",
            "type": "POST",
            "dataSrc": "results"
        },
        "columns": [
            {"data": "Reserva.id_reserva", "name": "Reserva.id_reserva", "title": "Número reserva"},
            {"data": "Ruta.nombre_ruta", "name": "Ruta.nombre_ruta", "title": "Nombre ruta", "searchable": false, "orderable": false},
            {"data": "Parada.nombre_parada", "name": "Parada.nombre_parada", "title": "Parada"},
            {"data": "RecorridoRealizado.fecha_salida", "name": "RecorridoRealizado.fecha_salida", "title": "Fecha salida recorrido", "searchable": false, "orderable": false},
            {"data": "Reserva.estado_reserva", "name": "Reserva.estado_reserva", "title": "Estado"},
            {"data": "Reserva.fecha_modificacion_reserva", "name": "Reserva.fecha_modificacion_reserva", "title": "Fecha modificación"}
        ],
        "order": [0, "desc"]
    };
</script>
<?php
$this->end();

$this->start("navigation");
?>
<div class="link block">
    <?php echo $this->Html->link("Home", array('controller' => 'Index', 'action' => 'index')); ?>
</div>
<?php
$this->end();

$this->Js->set("mobile", $mobile);
?>
<div id="subcontent_wrapper">
    <h2>Mis Reservas</h2>
    <table class="dt" id="misReservasTable">
        <thead></thead>
        <tbody></tbody>
        <tfoot>
            <tr>
                <td><input type="text" value="Buscar"></td>
                <td></td>
                <td><input type="text" value="Buscar"></td>
                <td></td>
                <td><input type="text" value="Buscar"></td>
                <td><input type="text" value="Buscar"></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td><input type="button" value="Aplicar búsqueda"></td>
            </tr>
        </tfoot>
    </table>
</div>